﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="menumanage.aspx.cs" Inherits="UI_menumanage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>菜单管理</title>
    <link href="/css/default.css" rel="Stylesheet" />
</head>
<body>
    <form id="form1" runat="server">
    <ext:PageManager runat="server" />
    <ext:Panel ID="Panel1" Title="菜单管理" runat="server" AutoHeight="true" BodyPadding="5px"
        ShowBorder="True" ShowHeader="false" EnableBackgroundColor="true">
        <Items>
            <ext:GroupPanel runat="server" AutoHeight="true" Title="操作" ID="GroupPanel1" EnableCollapse="True">
                <Items>
                    <ext:SimpleForm ID="SimpleForm1" runat="server" EnableBackgroundColor="true" ShowBorder="False"
                        ShowHeader="False" LabelAlign="Right">
                        <Items>
                            <ext:HiddenField ID="TxbID" runat="server">
                            </ext:HiddenField>
                            <ext:HiddenField ID="TxbOldTreeLevel" runat="server">
                            </ext:HiddenField>
                            <ext:TextBox ID="TxbConText" Label="菜单名称" runat="server" MaxLength="10" Required="true"
                                ShowRedStar="true">
                            </ext:TextBox>
                            <ext:DropDownList Label="父级" AutoPostBack="false" Required="true" EnableSimulateTree="true"
                                runat="server" ID="DDLParentId">
                            </ext:DropDownList>
                            <ext:TextBox ID="TxbLink" Label="URL" runat="server" Width="300px">
                            </ext:TextBox>
                            <ext:CheckBoxList ID="CkbPower" Label="角色权限" ColumnNumber="3" runat="server">
                            </ext:CheckBoxList>
                            <ext:NumberBox ID="TxbPaixu" Label="排序" runat="server" Width="100px" Required="true"
                                ShowRedStar="true">
                            </ext:NumberBox>
                            <ext:Button ID="BtnMenuAct" Text="确定添加" runat="server" OnClick="BtnMenuAct_Click"
                                ValidateForms="SimpleForm1">
                            </ext:Button>
                        </Items>
                    </ext:SimpleForm>
                </Items>
            </ext:GroupPanel>
        </Items>
        <Items>
            <ext:Grid ID="Grid1" Title="菜单列表" ShowBorder="true" ShowHeader="true" AutoHeight="true"
                runat="server" EnableCheckBoxSelect="false" DataKeyNames="Id,Context" EnableRowNumber="True"
                OnRowCommand="Grid1_RowCommand" ForceFitAllTime="true">
                <Columns>
                    <ext:BoundField DataField="Context" DataSimulateTreeLevelField="TreeLevel" DataFormatString="{0}"
                        HeaderText="菜单名称" ExpandUnusedSpace="True" />
                    <ext:BoundField DataField="link" DataFormatString="{0}" HeaderText="URL" />
                    <ext:BoundField DataField="Power" DataFormatString="{0}" HeaderText="权限" Hidden="true" />
                    <ext:TemplateField HeaderText="权限">
                        <ItemTemplate>
                            <%#GetPowerNamesByIds(Eval("Power").ToString())%>
                        </ItemTemplate>
                    </ext:TemplateField>
                    <ext:BoundField DataField="paixu" DataFormatString="{0}" HeaderText="排序" />
                    <ext:LinkButtonField HeaderText="编辑" Icon="Pencil" CommandName="ActionEdit" />
                    <ext:LinkButtonField HeaderText="删除" Icon="Delete" CommandName="ActionDel" ConfirmText="此操作会一并删除子菜单"
                        ConfirmTarget="Top" />
                </Columns>
            </ext:Grid>
        </Items>
    </ext:Panel>
    </form>
</body>
</html>
